package com.qrxl.user.vo.req;

import com.qrxl.common.EnumValue;
import com.qrxl.enums.EnumMenuTabFlag;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

@Data
@ApiModel(value = "新增菜单请求参数", description = "请求参数类")
public class MenuAddReq {

    @NotNull(message = "名称不能为空")
    @Length(message = "名称长度 {min}到{max}字符", max = 20, min = 1)
    @ApiModelProperty(value = "名称", required = true)
    private String name;

    @ApiModelProperty(value = "上级id")
    private String parentId;

    @Length(message = "url 超过{max}字符", max = 50)
    @ApiModelProperty(value = "url")
    private String url;

    @Length(message = "图标 {min}到{max}字符之间", max = 50)
    @ApiModelProperty(value = "图标")
    private String menuIcon;

    @Length(message = "描述 {min}到{max}字符之间", max = 100)
    @ApiModelProperty(value = "描述")
    private String description;

    @NotNull(message = "tabFlag不能为空")
    @ApiModelProperty(value = "是否在新标签打开：EnumMenuTabFlag")
    @EnumValue(enumClass = EnumMenuTabFlag.class, message = "tabFlag不合法")
    private Integer tabFlag;
}
